<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LINE 1 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-1"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-comment">{- |
   Module      :  System.Win32.Automation.Input.Key
   Copyright   :  2013 shelarcy
   License     :  BSD-style

   Maintainer  :  shelarcy@gmail.com
   Stability   :  Provisional
   Portability :  Non-portable (Win32 API)

   Keyboard input events
-}</span><span>
</span><span id="line-13"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Win32.Automation.Input.Key</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.Ptr.html#"><span class="hs-identifier">Foreign.Ptr</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier">Ptr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.Storable.html#"><span class="hs-identifier">Foreign.Storable</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Foreign.Storable.html#Storable"><span class="hs-identifier">Storable</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Win32.Types.html"><span class="hs-identifier">System.Win32.Types</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="System.Win32.Types.html#ULONG_PTR"><span class="hs-identifier">ULONG_PTR</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Win32.Word.html"><span class="hs-identifier">System.Win32.Word</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="System.Win32.Types.html#DWORD"><span class="hs-identifier">DWORD</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Win32.Types.html#WORD"><span class="hs-identifier">WORD</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">type</span><span> </span><span id="PKEYBDINPUT"><span class="annot"><a href="System.Win32.Automation.Input.Key.html#PKEYBDINPUT"><span class="hs-identifier hs-var">PKEYBDINPUT</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="System.Win32.Automation.Input.Key.html#KEYBDINPUT"><span class="hs-identifier hs-type">KEYBDINPUT</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">data</span><span> </span><span id="KEYBDINPUT"><span class="annot"><a href="System.Win32.Automation.Input.Key.html#KEYBDINPUT"><span class="hs-identifier hs-var">KEYBDINPUT</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="KEYBDINPUT"><span class="annot"><a href="System.Win32.Automation.Input.Key.html#KEYBDINPUT"><span class="hs-identifier hs-var">KEYBDINPUT</span></a></span></span><span>
</span><span id="line-26"></span><span>     </span><span class="hs-special">{</span><span> </span><span id="wVk"><span class="annot"><span class="annottext">KEYBDINPUT -&gt; WORD
</span><a href="System.Win32.Automation.Input.Key.html#wVk"><span class="hs-identifier hs-var hs-var">wVk</span></a></span></span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.Types.html#WORD"><span class="hs-identifier hs-type">WORD</span></a></span><span>
</span><span id="line-27"></span><span>     </span><span class="hs-special">,</span><span> </span><span id="wScan"><span class="annot"><span class="annottext">KEYBDINPUT -&gt; WORD
</span><a href="System.Win32.Automation.Input.Key.html#wScan"><span class="hs-identifier hs-var hs-var">wScan</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.Types.html#WORD"><span class="hs-identifier hs-type">WORD</span></a></span><span>
</span><span id="line-28"></span><span>     </span><span class="hs-special">,</span><span> </span><span id="dwFlags"><span class="annot"><span class="annottext">KEYBDINPUT -&gt; DWORD
</span><a href="System.Win32.Automation.Input.Key.html#dwFlags"><span class="hs-identifier hs-var hs-var">dwFlags</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">DWORD</span></a></span><span>
</span><span id="line-29"></span><span>     </span><span class="hs-special">,</span><span> </span><span id="time"><span class="annot"><span class="annottext">KEYBDINPUT -&gt; DWORD
</span><a href="System.Win32.Automation.Input.Key.html#time"><span class="hs-identifier hs-var hs-var">time</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">DWORD</span></a></span><span>
</span><span id="line-30"></span><span>     </span><span class="hs-special">,</span><span> </span><span id="dwExtraInfo"><span class="annot"><span class="annottext">KEYBDINPUT -&gt; ULONG_PTR
</span><a href="System.Win32.Automation.Input.Key.html#dwExtraInfo"><span class="hs-identifier hs-var hs-var">dwExtraInfo</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.Types.html#ULONG_PTR"><span class="hs-identifier hs-type">ULONG_PTR</span></a></span><span>
</span><span id="line-31"></span><span>     </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span id="local-6989586621679117604"><span id="local-6989586621679117606"><span id="local-6989586621679117618"><span class="annot"><span class="annottext">Int -&gt; KEYBDINPUT -&gt; ShowS
[KEYBDINPUT] -&gt; ShowS
KEYBDINPUT -&gt; String
(Int -&gt; KEYBDINPUT -&gt; ShowS)
-&gt; (KEYBDINPUT -&gt; String)
-&gt; ([KEYBDINPUT] -&gt; ShowS)
-&gt; Show KEYBDINPUT
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [KEYBDINPUT] -&gt; ShowS
$cshowList :: [KEYBDINPUT] -&gt; ShowS
show :: KEYBDINPUT -&gt; String
$cshow :: KEYBDINPUT -&gt; String
showsPrec :: Int -&gt; KEYBDINPUT -&gt; ShowS
$cshowsPrec :: Int -&gt; KEYBDINPUT -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679117593"><span id="local-6989586621679117595"><span id="local-6989586621679117597"><span id="local-6989586621679117599"><span class="annot"><a href="../../base/src/Foreign.Storable.html#Storable"><span class="hs-identifier hs-type">Storable</span></a></span><span> </span><span class="annot"><a href="System.Win32.Automation.Input.Key.html#KEYBDINPUT"><span class="hs-identifier hs-type">KEYBDINPUT</span></a></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-34"></span><span>    </span><span id="local-6989586621679117587"><span class="annot"><span class="annottext">sizeOf :: KEYBDINPUT -&gt; Int
</span><a href="../../base/src/Foreign.Storable.html#sizeOf"><span class="hs-identifier hs-var hs-var hs-var hs-var">sizeOf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; KEYBDINPUT -&gt; Int
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">24</span></span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span class="hs-pragma">{-# LINE 35 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-identifier">alignment</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">8</span><span>
</span><span id="line-36"></span><span class="hs-pragma">{-# LINE 36 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">input</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-37"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span>     </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wVk</span><span> </span><span class="hs-identifier">input</span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span class="hs-pragma">{-# LINE 38 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-38"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wScan</span><span> </span><span class="hs-identifier">input</span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span class="hs-pragma">{-# LINE 39 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-39"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">dwFlags</span><span> </span><span class="hs-identifier">input</span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span class="hs-pragma">{-# LINE 40 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-40"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">8</span><span class="hs-special">)</span><span class="hs-special">)</span><span>    </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">time</span><span> </span><span class="hs-identifier">input</span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span class="hs-pragma">{-# LINE 41 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-41"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">dwExtraInfo</span><span> </span><span class="hs-identifier">input</span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span class="hs-pragma">{-# LINE 42 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-43"></span><span>        </span><span class="hs-identifier">wVk'</span><span>         </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-44"></span><span class="hs-pragma">{-# LINE 44 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-44"></span><span>        </span><span class="hs-identifier">wScan'</span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-45"></span><span class="hs-pragma">{-# LINE 45 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-45"></span><span>        </span><span class="hs-identifier">dwFlags'</span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-46"></span><span class="hs-pragma">{-# LINE 46 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-46"></span><span>        </span><span class="hs-identifier">time'</span><span>        </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">8</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-47"></span><span class="hs-pragma">{-# LINE 47 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-47"></span><span>        </span><span class="hs-identifier">dwExtraInfo'</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">16</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-48"></span><span class="hs-pragma">{-# LINE 48 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-48"></span><span>        </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">KEYBDINPUT</span><span> </span><span class="hs-identifier">wVk'</span><span> </span><span class="hs-identifier">wScan'</span><span> </span><span class="hs-identifier">dwFlags'</span><span> </span><span class="hs-identifier">time'</span><span> </span><span class="hs-identifier">dwExtraInfo'</span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="annot"><a href="System.Win32.Automation.Input.Key.html#kEYEVENTF_EXTENDEDKEY"><span class="hs-identifier hs-type">kEYEVENTF_EXTENDEDKEY</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">DWORD</span></a></span><span>
</span><span id="line-51"></span><span id="kEYEVENTF_EXTENDEDKEY"><span class="annot"><span class="annottext">kEYEVENTF_EXTENDEDKEY :: DWORD
</span><a href="System.Win32.Automation.Input.Key.html#kEYEVENTF_EXTENDEDKEY"><span class="hs-identifier hs-var hs-var">kEYEVENTF_EXTENDEDKEY</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">DWORD
</span><span class="hs-number">1</span></span><span>
</span><span id="line-52"></span><span class="annot"><a href="System.Win32.Automation.Input.Key.html#kEYEVENTF_KEYUP"><span class="hs-identifier hs-type">kEYEVENTF_KEYUP</span></a></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">DWORD</span></a></span><span>
</span><span id="line-53"></span><span id="kEYEVENTF_KEYUP"><span class="annot"><span class="annottext">kEYEVENTF_KEYUP :: DWORD
</span><a href="System.Win32.Automation.Input.Key.html#kEYEVENTF_KEYUP"><span class="hs-identifier hs-var hs-var">kEYEVENTF_KEYUP</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">DWORD
</span><span class="hs-number">2</span></span><span>
</span><span id="line-54"></span><span class="annot"><a href="System.Win32.Automation.Input.Key.html#kEYEVENTF_SCANCODE"><span class="hs-identifier hs-type">kEYEVENTF_SCANCODE</span></a></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">DWORD</span></a></span><span>
</span><span id="line-55"></span><span id="kEYEVENTF_SCANCODE"><span class="annot"><span class="annottext">kEYEVENTF_SCANCODE :: DWORD
</span><a href="System.Win32.Automation.Input.Key.html#kEYEVENTF_SCANCODE"><span class="hs-identifier hs-var hs-var">kEYEVENTF_SCANCODE</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">DWORD
</span><span class="hs-number">8</span></span><span>
</span><span id="line-56"></span><span class="annot"><a href="System.Win32.Automation.Input.Key.html#kEYEVENTF_UNICODE"><span class="hs-identifier hs-type">kEYEVENTF_UNICODE</span></a></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Win32.Types.html#DWORD"><span class="hs-identifier hs-type">DWORD</span></a></span><span>
</span><span id="line-57"></span><span id="kEYEVENTF_UNICODE"><span class="annot"><span class="annottext">kEYEVENTF_UNICODE :: DWORD
</span><a href="System.Win32.Automation.Input.Key.html#kEYEVENTF_UNICODE"><span class="hs-identifier hs-var hs-var">kEYEVENTF_UNICODE</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">DWORD
</span><span class="hs-number">4</span></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="hs-pragma">{-# LINE 56 &quot;libraries\\Win32\\System\\Win32\\Automation\\Input\\Key.hsc&quot; #-}</span><span>
</span><span id="line-56"></span></pre></body></html>